package com.flbill.mapper;

import com.flbill.pojo.entity.SignIn;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;

@Mapper
public interface SignInMapper {
    @Insert("insert into sign_in (user_id, sign_date, create_time) values (#{userId}, #{signDate}, #{createTime})")
    void signIn(SignIn signIn);

    @Select("select count(*) from sign_in where sign_date between #{start} and #{end}")
    Integer countSignIn(LocalDate start, LocalDate end);

    @Select("select * from sign_in where user_id = #{userId} and sign_date = #{signDate}")
    SignIn qurryBySignDate(SignIn signIn);
}
